package com.boarsoft.boar.lib.action;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.boarsoft.bean.ReplyInfo;
import com.boarsoft.boar.entity.AppInfo;
import com.boarsoft.boar.lib.LibAppBiz;
import com.boarsoft.common.Authorized;
import com.boarsoft.common.dao.PagedResult;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;

@RestController
@RequestMapping("/lib/app")
public class LibAppAction {
	@Autowired
	private LibAppBiz libAppBiz;

	/**
	 * 
	 * @param libId
	 * @param key
	 * @param orderBy
	 * @param pageNo
	 * @param pageSize
	 * @return
	 */
	@JsonIgnoreProperties({ "svcs", "insts", "libs", "files", "protocols" })
	@RequestMapping("/list.do")
	@Authorized(code = "lib.app.list")
	public ReplyInfo<Object> list(String libId, String key, String orderBy, int pageNo, int pageSize) {
		PagedResult<AppInfo> pr = libAppBiz.list(libId, key, orderBy, pageNo, pageSize);
		return new ReplyInfo<Object>(true, pr);
	}
}